#version 150

in vec3 Position;
in vec4 Color;
in vec2 UV0;
in ivec2 UV2;

uniform sampler2D Sampler2;

uniform mat4 ModelViewMat;
uniform mat4 ProjMat;
uniform float GameTime;

out float vertexDistance;
out vec4 vertexColor;
out vec4 ColorShader;
out vec2 texCoord0;

void main() {
    gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);

    vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
    vertexColor = Color;
    ColorShader = texelFetch(Sampler2, UV2 / 16, 0);
    if (Color.rgb == vec3(114.0/255.0,51.0/255.0,4.0/255.0)){
        //gl_Position.y += sin(GameTime*3600 + gl_Position.x*50 + vertexDistance/5) / 100;
    }
    texCoord0 = UV0;
}
